home *** CD-ROM | disk | FTP | other *** search
/ Amiga Mag HDD Backup / Amiga Mag HDD Backup.zip / Amiga Mag HDD Backup / Alexander.img.bin / Alexander.img / 315 2 files Archive.sit / Any plain-text files / ? Any plain-text file 94 < prev    next >
Text File  |  1995-01-03  |  6KB  |  209 lines

  1. ts 1,1000
  2.                 InitialInteger 4
  3.                 Border DOUBLEBEVEL ,2,1
  4.             EndScript
  5.             OnRelease
  6.                 SetObjectState "MaxNoteDurVar",ON
  7.             EndScript
  8.         EndObj
  9.         IntegerField "MaxNoteDurVar"
  10.             Definition
  11.                 Origin 432,48
  12.                 Size 81,8
  13.                 Justification RIGHT 
  14.                 MaxFieldLength 1
  15.                 Limits 0,6
  16.                 InitialInteger 1
  17.                 Border DOUBLEBEVEL ,2,1
  18.             EndScript
  19.             OnRelease
  20.                 SetObjectState "MaxNoteVar",ON
  21.             EndScript
  22.         EndObj
  23.         IntegerField "MaxNoteVar"
  24.             Definition
  25.                 Origin 432,72
  26.                 Size 81,8
  27.                 Justification RIGHT 
  28.                 MaxFieldLength 2
  29.                 Limits 1,12
  30.                 InitialInteger 2
  31.                 Border DOUBLEBEVEL ,2,1
  32.             EndScript
  33.             OnRelease
  34.                 SetObjectState "NumMeasures",ON
  35.             EndScript
  36.         EndObj
  37.         TextButton "Generate"
  38.             Definition
  39.                 Origin 536,24
  40.                 Font "topaz",8
  41.                 Style SHADOW ,2,3
  42.                 TextColors 1,0,JAM1 
  43.                 Text " Generate "
  44.                 Border BEVEL ,2,1
  45.                 Highlight COMPLEMENT 
  46.                 ButtonFlags NONE 
  47.             EndScript
  48.             OnRelease
  49.                 Nop ; Clear current score and lock display
  50.                 SendMessage "CLEAR FORCE"
  51.                 SendMessage "LOCKDISPLAY"
  52.                 SendMessage "LOCKGUI"
  53.                 Nop ; Set key and time signatures
  54.                 SendMessage "SETKEYSIGNATURE "||KeyText[KeyTextIndex]||" 0 0"
  55.                 SendMessage "SETTIMESIGNATURE "||Beats||" "||NoteBeat||" 0"
  56.                 Nop ; Get user defined values from fields
  57.                 Let TotalBeats=Beats*IntegerFrom("NumMeasures")
  58.                 Let MNV=IntegerFrom("MaxNoteVar")
  59.                 Let MNDV=IntegerFrom("MaxNoteDurVar")
  60.                 Nop ; Initialize variables for loop
  61.                 Let NumBeats=0
  62.                 Let NumBeatsMeasure=0
  63.                 Let Line=0
  64.                 Nop ; Loop until all measures filled
  65.                 While NumBeats<TotalBeats
  66.                     Nop ; Calc note line based on random variation
  67.                     Let LineVar=Random(-MNV,MNV)
  68.                     Let Line=Line+LineVar
  69.                     Nop ; Calc note beat based on random variation
  70.                     Let CurNoteBeatVar=Random(-MNDV,MNDV)
  71.                     Let CurNoteBeat=Integer(NoteBeat*(2^CurNoteBeatVar))
  72.                     Nop ; Make sure note beat is within acceptable range 1-64
  73.                     Let CurNoteBeat=Min(64,Max(1,CurNoteBeat))
  74.                     Nop ; Make sure notes near end of measure do not exceed
  75.                     Nop ; maximum allowable
  76.                     While (NumBeatsMeasure+NoteBeat/CurNoteBeat)>Beats
  77.                         Let CurNoteBeat=CurNoteBeat*2
  78.                     EndLoop
  79.                     Nop ; Insert the note and go to next position
  80.                     SendMessage "INSERTITEM NOTE DURATION "||CurNoteBeat||" LINE "||Line
  81.                     SendMessage "NEXT NOTE"
  82.                     Nop ; Update the number of current beats in the song and
  83.                     Nop ; the current measure
  84.                     Let NumBeats=NumBeats+NoteBeat/CurNoteBeat
  85.                     Let NumBeatsMeasure=NumBeatsMeasure+NoteBeat/CurNoteBeat
  86.                     Nop ; Go to next measure if current one full
  87.                     If NumBeatsMeasure>=Beats
  88.                         SendMessage "NEXT MEASURE"
  89.                         Let NumBeats=Integer(NumBeats)
  90.                         Let NumBeatsMeasure=0
  91.                     EndIf
  92.                 EndLoop
  93.                 Nop ; Unlock the display, activate song window,
  94.                 Nop ; update the display, and go to the first measure
  95.                 SendMessage "UNLOCKGUI"
  96.                 SendMessage "UNLOCKDISPLAY"
  97.                 SendMessage "WINDOW DOCUMENT ACTIVATE"
  98.                 SendMessage "UPDATEDISPLAY"
  99.                 SendMessage "POSITION SOF"
  100.             EndScript
  101.         EndObj
  102.         TextButton "Play"
  103.             Definition
  104.                 Origin 536,48
  105.                 Font "topaz",8
  106.                 Style SHADOW ,2,3
  107.                 TextColors 1,0,JAM1 
  108.                 Text "   Play   "
  109.                 Border BEVEL ,2,1
  110.                 Highlight COMPLEMENT 
  111.                 ButtonFlags NONE 
  112.             EndScript
  113.             OnRelease
  114.                 Nop ; Activate the song window and play song
  115.                 SendMessage "WINDOW DOCUMENT ACTIVATE"
  116.                 SendMessage "PLAY"
  117.             EndScript
  118.         EndObj
  119.         TextButton "Stop"
  120.             Definition
  121.                 Origin 536,72
  122.                 Font "topaz",8
  123.                 Style SHADOW ,2,3
  124.                 TextColors 1,0,JAM1 
  125.                 Text "   Stop   "
  126.                 Border BEVEL ,2,1
  127.                 Highlight COMPLEMENT 
  128.                 ButtonFlags NONE 
  129.             EndScript
  130.             OnRelease
  131.                 Nop ; Stop playing the song
  132.                 SendMessage "STOP"
  133.             EndScript
  134.         EndObj
  135.         ImageButton "BeatsLeft"
  136.             Definition
  137.                 Origin 110,60
  138.                 Image "RCF:CanDo2.51/Brushes/Left.br"
  139.                 Shape "RCF:CanDo2.51/Brushes/Left.br"
  140.                 Highlight COMPLEMENT 
  141.                 ButtonFlags NONE 
  142.             EndScript
  143.             OnClick
  144.                 Nop ; Change beats while pressing button
  145.                 Nop ; Do not allow value below 1
  146.                 Loop
  147.                     Let Beats=Max(Beats-1,1)
  148.                     Do "ShowTime"
  149.                     Delay 0,0,10
  150.                 Until ObjectState("BeatsLeft")=OFF
  151.             EndScript
  152.         EndObj
  153.         ImageButton "BeatsRight"
  154.             Definition
  155.                 Origin 132,60
  156.                 Image "RCF:CanDo2.51/Brushes/Right.br"
  157.                 Shape "RCF:CanDo2.51/Brushes/Right.br"
  158.                 Highlight COMPLEMENT 
  159.                 ButtonFlags NONE 
  160.             EndScript
  161.             OnClick
  162.                 Nop ; Change beats while pressing button
  163.                 Nop ; Do not allow value above 16
  164.                 Loop
  165.                     Let Beats=Min(Beats+1,16)
  166.                     Do "ShowTime"
  167.                     Delay 0,0,10
  168.                 Until ObjectState("BeatsRight")=OFF
  169.             EndScript
  170.         EndObj
  171.         ImageButton "NoteBeatLeft"
  172.             Definition
  173.                 Origin 110,72
  174.                 Image "RCF:CanDo2.51/Brushes/Left.br"
  175.                 Shape "RCF:CanDo2.51/Brushes/Left.br"
  176.                 Highlight COMPLEMENT 
  177.                 ButtonFlags NONE 
  178.             EndScript
  179.             OnClick
  180.                 Nop ; Change beats while pressing button
  181.                 Nop ; Do not allow value below 1
  182.                 Loop
  183.                     Let NoteBeat=Max(NoteBeat/2,1)
  184.                     Do "ShowTime"
  185.                     Delay 0,0,10
  186.                 Until ObjectState("NoteBeatLeft")=OFF
  187.             EndScript
  188.         EndObj
  189.         ImageButton "NoteBeatRight"
  190.             Definition
  191.                 Origin 132,72
  192.                 Image "RCF:CanDo2.51/Brushes/Right.br"
  193.                 Shape "RCF:CanDo2.51/Brushes/Right.br"
  194.                 Highlight COMPLEMENT 
  195.                 ButtonFlags NONE 
  196.             EndScript
  197.             OnClick
  198.                 Nop ; Change beats while pressing button
  199.                 Nop ; Do not allow value above 64
  200.                 Loop
  201.                     Let NoteBeat=Min(NoteBeat*2,64)
  202.                     Do "ShowTime"
  203.                     Delay 0,0,10
  204.                 Until ObjectState("NoteBeatRight")=OFF
  205.             EndScript
  206.         EndObj
  207.     EndObj
  208. EndObj
  209. ■0└≤w■s3²■ °fⁿ ⁿαÇD@ ° ≡Ç?≈Çä?c?D??c? ≈`└÷p c3 °└0└≤c{>3> > > °ⁿîⁿα